package com.wushi.lenovo.asia5b.app_model.other;

import android.text.TextUtils;

import com.mvp.base.model.BaseModel;
import com.wushi.lenovo.asia5b.app_config.AppExtendsKt;

/**
 * Created by zhangyuncai on 2018/9/27.
 * APP登录者信息
 */
public class UserInfo extends BaseModel {

    public static UserInfo getUserInfo() {
        return AppExtendsKt.getCacheUserInfo();
    }

    public static int getMemberId() {
        return getUserInfo().getId();
    }

    public static String getUserToken() {
        return getUserInfo().userToken;
    }

    public static int getCountryId() {
        return getUserInfo().getCountry_id();
    }

    private int id;//会员ID
    private Object group_id;//
    private int language_id;//语言id
    private int country_id;//国家id
    private String birthday;//生日
    private String avatar_url;//头像地址
    private String name;//昵称
    private String email;//邮箱
    private String mobile;//手机号
    private String verified;//身份token
    private String gender;//性别
    private int status;//登录状态
    private String calling_code;//
    private String symbol_left;//
    private String currency_code;//货币类型
    private Object agent_id;//
    private String has_pay_pass;//是否设置支付密码:如果成员未设置则返回0，如果成员已设置则返回1
    private String has_login_pass;//是否有登录密码:如果成员未设置则返回0，如果成员已设置则返回1
    private String card_number;
    private String card_name;
    private String card_exp;
    private String card_cvv;
    /**
     * 单独设置
     */
    private String userToken;

    public void setUserToken(String userToken) {
        this.userToken = userToken;
    }


    public boolean getHas_pay_pass() {
        return TextUtils.equals(has_pay_pass, "1");
    }

    public void setHas_login_pass(String has_login_pass) {
        this.has_login_pass = has_login_pass;
    }

    public boolean getHas_login_pass() {
        return TextUtils.equals(has_login_pass, "1");
    }

    public void setHas_pay_pass(String has_pay_pass) {
        this.has_pay_pass = has_pay_pass;
    }

    public int getId() {
        return id;
    }

    public Object getGroup_id() {
        return group_id;
    }

    public int getLanguage_id() {
        return language_id;
    }

    public int getCountry_id() {
        return country_id;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public void setAvatar_url(String avatar_url) {
        this.avatar_url = avatar_url;
    }

    public String getAvatar_url() {
        return avatar_url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getVerified() {
        return verified;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getStatus() {
        return status;
    }

    public String getCalling_code() {
        return calling_code;
    }

    public String getSymbol_left() {
        return symbol_left;
    }

    public String getCurrency_code() {
        return currency_code;
    }

    public Object getAgent_id() {
        return agent_id;
    }

    public String getCard_number() {
        return card_number;
    }

    public String getCard_name() {
        return card_name;
    }

    public String getCard_exp() {
        return card_exp;
    }

    public String getCard_cvv() {
        return card_cvv;
    }


    @Override
    public String toString() {
        return "UserInfo{" +
                "id=" + id +
                ", group_id=" + group_id +
                ", language_id=" + language_id +
                ", country_id=" + country_id +
                ", birthday='" + birthday + '\'' +
                ", avatar_url='" + avatar_url + '\'' +
                ", name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", mobile='" + mobile + '\'' +
                ", verified='" + verified + '\'' +
                ", gender='" + gender + '\'' +
                ", status=" + status +
                ", calling_code='" + calling_code + '\'' +
                ", symbol_left='" + symbol_left + '\'' +
                ", currency_code='" + currency_code + '\'' +
                ", agent_id=" + agent_id +
                ", has_pay_pass='" + has_pay_pass + '\'' +
                ", card_number='" + card_number + '\'' +
                ", card_name='" + card_name + '\'' +
                ", card_exp='" + card_exp + '\'' +
                ", card_cvv='" + card_cvv + '\'' +
                '}';
    }

    /**
     * id : 48
     * group_id : null
     * language_id : 1
     * country_id : 101
     * birthday : 17-07-1997
     * avatar_url : https://asia-allnet.com:8000/images/img_avatar.png
     * name : fangkeweiyou
     * email : www.fangkeweiyou@qq.com
     * mobile : 15889636926
     * verified : 0
     * gender : f
     * status : 1
     * calling_code : 86
     * symbol_left : null
     * currency_code : CNY
     * agent_id : null
     */
}
